package com.jyb.qiyefuwu.view.fragment.usercenter;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;

import com.jyb.qiyefuwu.R;
import com.jyb.qiyefuwu.base.MBaseFragment;
import com.jyb.qiyefuwu.databinding.FragmentFwMakovermainBinding;
import com.jyb.qiyefuwu.uitls.CommPagerAdapter3;
import com.swgk.core.base.AppLazyFragment;
import com.swgk.core.common.base.BaseViewModel;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

public class IntellectualPropertyFollowFragment extends AppLazyFragment {

    private ArrayList<Fragment> mFragments = new ArrayList<>();
    private String[] type = new String[]{"商标交易", "专利交易", "版权交易"};

    private FragmentFwMakovermainBinding mBinding;


    @Nullable
    @org.jetbrains.annotations.Nullable
    @Override
    public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
        mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_fw_makovermain, container, false);
        return mBinding.getRoot();
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    @Override
    protected void initView() {
        super.initView();
        mFragments.add(Fw_IntellpropFragement.newInstance(0));
        mFragments.add(Fw_IntellpropFragement.newInstance(1));
        mFragments.add(Fw_IntellpropFragement.newInstance(2));
        CommPagerAdapter3 pagerAdapter = new CommPagerAdapter3(getChildFragmentManager(), mFragments, type);
        mBinding.viewpager.setOffscreenPageLimit(type.length);
        mBinding.viewpager.setAdapter(pagerAdapter);
        mBinding.tabLayout.setupWithViewPager(mBinding.viewpager);
        mBinding.tabLayout.getTabAt(0).select();
    }

    public static IntellectualPropertyFollowFragment newInstance() {
        IntellectualPropertyFollowFragment fragment = new IntellectualPropertyFollowFragment();
        return fragment;
    }

    @Override
    protected void onLazyLoad() {

    }
}
